home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2586 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. Path: alpha.sky.net!ip53
  2. From: toma@sky.net (Tom Armstrong)
  3. Newsgroups: comp.os.ms-windows.programmer.ole,comp.lang.c++
  4. Subject: Re: Problems VC++4.0 & StringFromCLSID function
  5. Date: 18 Jan 1996 16:28:27 GMT
  6. Organization: SkyNET Online
  7. Message-ID: <4dlsfb$5ip@alpha.sky.net>
  8. References: <4djn2d$mps@earth.superlink.net>
  9. NNTP-Posting-Host: ip53.sky.net
  10. X-Newsreader: News Xpress Version 1.0 Beta #3
  11.  
  12. In article <4djn2d$mps@earth.superlink.net>,
  13.    ananda@mars.superlink.net (Ananda Subramaniam) wrote:
  14. >Hi,
  15. >
  16. >I have an OLE sample that I wrote and compiled in VC++ 2.0 without any 
  17. problems.
  18. >However, when I tried to compile in VC++ 4.0, I had trouble with the
  19. >StringFromCLSID function. 
  20. >
  21. >I get a message "cannot convert 2nd parameter char ** to unsigned short**"
  22. >
  23. >....
  24. >The compiler seems to think that LPOLESTR is of type unsigned short.
  25. >To further confirm this, I changed the type of my string to LPOLESTR and the 
  26. >compiler went past StringFromCLSID function but complained on the next line
  27. >where I had AfxMessageBox(mystr).  The compiler said "non of the 2 overloads 
  28. can
  29. >covert parameter one from type unsigned short * "
  30. >
  31. >...
  32.  
  33. >I am running out of ideas, plus it does not help being the only C++ 
  34. programmer
  35. >in the office.   Any help will be appreciated.
  36.  
  37. >Ananda
  38. >email: ananda@mars.superlink.net
  39.  
  40. Ananda,
  41.  
  42. One major change between VC++ 2.0 and VC++ 4.0 is the support for Unicode. All 
  43. OLE functions require Unicode strings. That's why it wants and "unsigned 
  44. short**". 2.x provided this translation for you, but 4.0 does not. Check out 
  45. Tech Note 59. And if you need source examples, check out my FAQ under "General 
  46. Questions"/"Converting from 2.0 to 4.0" at http://www.sky.net/~toma.
  47.  
  48. TwA
  49.  
  50.